#include "StdAfx.h"
#include "Picture.h"
#include "graphlibHTW.h"
#include "Constants.h"

Picture::Picture(void)
{

}

// operator overloading
Picture *Picture::operator=(Picture *_picture)
{
	htwDeleteImage(this->pic);	
	this->pic = (unsigned char *)htwCreateImage(FILENAME_PLACEHOLDER,_picture->pHeight,_picture->pWidth,_picture->pBytesPerPixel);
	this->pWidth = _picture->pWidth;
	this->pHeight = _picture->pHeight;
	this->pBytesPerPixel = _picture->pBytesPerPixel;

	return this;
}

// ctor
Picture::Picture(unsigned char *_pic, int _pWidth, int _pHeight, int _pBytesPerPixel)
{
	this->pic = _pic;
	this->pWidth = _pWidth;
	this->pHeight = _pHeight;
	this->pBytesPerPixel = _pBytesPerPixel;
}

//dtor
Picture::~Picture(void)
{
	htwDeleteImage(this->pic);	
}

// ctor
Picture::Picture(Picture *_picture)
{	
	this->pic = (unsigned char *)htwCreateImage(FILENAME_PLACEHOLDER,_picture->pHeight,_picture->pWidth,_picture->pBytesPerPixel);
	this->pWidth = _picture->pWidth;
	this->pHeight = _picture->pHeight;
	this->pBytesPerPixel = _picture->pBytesPerPixel;
}
